/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package persistencia;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author hellen
 */
@Entity
@Table(name = "DOCUMENTO")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Documento.findAll", query = "SELECT d FROM Documento d"),
    @NamedQuery(name = "Documento.findByDocumentoID", query = "SELECT d FROM Documento d WHERE d.documentoID = :documentoID"),
    @NamedQuery(name = "Documento.findByDocNombre", query = "SELECT d FROM Documento d WHERE d.docNombre = :docNombre"),
    @NamedQuery(name = "Documento.findByDocNumero", query = "SELECT d FROM Documento d WHERE d.docNumero = :docNumero"),
    @NamedQuery(name = "Documento.findByDocDescripcion", query = "SELECT d FROM Documento d WHERE d.docDescripcion = :docDescripcion")})
public class Documento implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "DocumentoID")
    private Integer documentoID;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 15)
    @Column(name = "Doc_Nombre")
    private String docNombre;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 10)
    @Column(name = "Doc_Numero")
    private String docNumero;
    @Size(max = 10)
    @Column(name = "Doc_Descripcion")
    private String docDescripcion;
    @JoinColumn(name = "Doc_EmpleadoID", referencedColumnName = "EmpleadoID")
    @ManyToOne(optional = false)
    private Empleado docEmpleadoID;
    @JoinColumn(name = "Doc_ClienteID", referencedColumnName = "ClienteID")
    @ManyToOne(optional = false)
    private Cliente docClienteID;

    public Documento() {
    }

    public Documento(Integer documentoID) {
        this.documentoID = documentoID;
    }

    public Documento(Integer documentoID, String docNombre, String docNumero) {
        this.documentoID = documentoID;
        this.docNombre = docNombre;
        this.docNumero = docNumero;
    }

    public Integer getDocumentoID() {
        return documentoID;
    }

    public void setDocumentoID(Integer documentoID) {
        this.documentoID = documentoID;
    }

    public String getDocNombre() {
        return docNombre;
    }

    public void setDocNombre(String docNombre) {
        this.docNombre = docNombre;
    }

    public String getDocNumero() {
        return docNumero;
    }

    public void setDocNumero(String docNumero) {
        this.docNumero = docNumero;
    }

    public String getDocDescripcion() {
        return docDescripcion;
    }

    public void setDocDescripcion(String docDescripcion) {
        this.docDescripcion = docDescripcion;
    }

    public Empleado getDocEmpleadoID() {
        return docEmpleadoID;
    }

    public void setDocEmpleadoID(Empleado docEmpleadoID) {
        this.docEmpleadoID = docEmpleadoID;
    }

    public Cliente getDocClienteID() {
        return docClienteID;
    }

    public void setDocClienteID(Cliente docClienteID) {
        this.docClienteID = docClienteID;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (documentoID != null ? documentoID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Documento)) {
            return false;
        }
        Documento other = (Documento) object;
        if ((this.documentoID == null && other.documentoID != null) || (this.documentoID != null && !this.documentoID.equals(other.documentoID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "persistencia.Documento[ documentoID=" + documentoID + " ]";
    }
    
}
